package com.thexb.sys.mapper;

import com.thexb.sys.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author thexb
 * @since 2023-04-04
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select x_role_menu.menu_id from x_role_menu, x_menu\n" +
        "where x_role_menu.menu_id = x_menu.menu_id\n" +
        "and x_menu.is_leaf = 'Y'\n" +
        "and x_role_menu.role_id = #{id}")
    Integer[] getMenuIdsByRoleId(int id);
}
